<?php

namespace app\admin\validate;

use app\common\enums\StatusEnum;
use app\admin\model\LangClassFile AS FileModel;
use think\Validate;

class LangClassFile extends Validate
{
    protected $rule = [
        'file_name|名称' => 'require|length:1,255|unique:lang_class_file',
        'file|上传文件' => 'require',
        'class_id' => 'require|number',
        'course_type' => 'require|number|in:' . FileModel::COURSE_VOICE . ',' . FileModel::COURSE_BASE . ',' . FileModel::COURSE_SENIOR,
        'type' => 'require|number|in:' . FileModel::TYPE_VIDEO . ',' . FileModel::TYPE_AUDIO . ',' . FileModel::TYPE_CLASS_FILE . ',' . FileModel::TYPE_HOMEWORK,
        'sort_num|权重' => 'require|number',
        'status' => 'in:' . StatusEnum::DISABLED . ',' . StatusEnum::ENABLED,
    ];
}